package ua.kharkov.knure.pereverziev.diploma.web.command;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

public class LogoutCommand implements Command {

	private static final long serialVersionUID = 9023775096787892174L;

	private static final Logger log = Logger.getLogger(LogoutCommand.class);

	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws IOException, ServletException {
		log.debug("Command starts");

		request.getSession().invalidate();

		log.debug("Command finished");

		return "/login.jsp";
	}

}
